const fs = require('fs')
const {resolve} = require('path')

const jwtParams = {
    jwtSecretKey: 'JimmyZhu'
}

const aliossParams = {
    region: 'oss-cn-shanghai',
    accessKeyId: 'LTAI5tBsvApk4NJoj8Ff4sHE',
    accessKeySecret: 'fR7JHMYuDmpwRRPTDtuWcMz1D99R2r',
    bucket: 'class-avatar',
    accessUrl: 'https://file.zhuhaoxian.tech/'
}

const aliyunMessageParams = {
    url: 'https://api-v2.xdclass.net/send_sms',
    appid: "gE9Nqjcoow77gId1Xp",
    appSecret: "IHFZwHX9pqezZPM4Xc4qEElMUvXjEq9s",
    templateCode: "SMS_168781429"
}

const huaweiCloudParams = {
    AK: 'AJAQBM4XS2TDJU65TKCI',
    SK: 'ekBjyhu6hcxEou0enpDk9UexApSKSdPZbHwON4yh',
    PROJECT_ID: '44985aa25b1f4dd1994a3c1764202bdb',
    REGION: 'cn-north-4',
    ENDPOINT: 'https://vod.cn-north-4.myhuaweicloud.com'
}

const rabbitMQParams = {
    hostname: '8.153.71.192',
    protocol: 'amqp',
    port: 5672,
    username: 'root',
    password: 'matrix11',
    vhost: '/'
}

const redisParams = {
    port: 6379,
    host: '8.153.71.192',
    password: 'matrix11'
}

const sequelizeParams = {
    database: 'edu',
    username: 'root',
    password: 'matrix11',
    options: {
        host: '8.153.71.192',
        dialect: 'mysql',
        timezone: '+08:00'
    }
}

const wechatLoginParams = {
    // 微信pc登录参数
    appId: 'GSs03c0jyWIWxVqRVK',
    appSecret: 'ndV9ljIFWbaVlquMTmMXluPhjOK4tEvR',
    accessTokenPC: `https://api-v2.xdclass.net/cgi-bin/token?grant_type=client_credential&appid=${this.appId}&secret=${this.appSecret}`,
    qrUrl: 'https://mp.weixin.qq.com/cgi-bin/showqrcode',
    // 微信app登录参数
    appAppId: 'wxaeb7d88492cf5dc9',
    appAppSecret: 'e936dc8686e1054ba6be173719b00d76',
    // 微信小程序登录参数
    weappAppId: 'wx619c430596404604',
    weappAppSecret: '8557c20fc6cd34e87a0e676ec44e5e50'
}

const wechatPayParams = {
    appid: 'wx5beac15ca207c40c', // 公众号appID
    mchid: '1601644442',  // 商户号mchID
    serial_no: '7064ADC5FE84CA2A3DDE71A692E39602DEB96E61', // 证书序列号，用于声明所使用的证书
    apiv3_private_key: 'k47rt4GYXinH6JwbjOUdNhrB4LPvvIHu', // APIv3密钥，用于声明所使用的证书
    notify_url: 'https://2vr253ri9048.vicp.fun/api/order/v1/callback', // 回调地址，用户微信通知消息
    private_key: fs.readFileSync(resolve(__dirname, '../apiclient_key.pem')).toString() // 秘钥，用于发起微信请求加密
}

module.exports = {
    jwtParams,
    aliossParams,
    aliyunMessageParams,
    huaweiCloudParams,
    rabbitMQParams,
    redisParams,
    sequelizeParams,
    wechatLoginParams,
    wechatPayParams
}